import React, { Component } from 'react';

import './index.less';
import { getQueryCondition } from 'src/hrpub/common/utils/utils'



class SearchModal extends Component {
    constructor(props) {
        super(props);

        this.goSearch = this.goSearch.bind(this);
    }

  

    goSearch() {
        let data = getQueryCondition(this.props, 'managescopequery');//获取查询区所有字段数据
        this.props.editTable.setTableData('queryResult', data)
        this.props.getSearchData(data);
        this.props.search.openAdvSearch('managescopequery', false);
        
    }
    
    render() {
        const {
            search,
            queryOid,
            searchVisible
        } = this.props;
        return (
            <div style={{
                display: searchVisible ? 'block' : 'none'
            }}>
                {search.NCCreateSearch('managescopequery', {
                    clickSearchBtn: this.goSearch,
                    onlyShowAdvArea: false,
                    showAdvSearchPlanBtn: true,
                    saveSearchPlan: true,
                    oid: queryOid,
                    onlyShowSuperBtn: true
                })}
            </div>
        );
    }
}

export default SearchModal;
